#include <xp/bas/string.h>
#include <xp/bas/stdio.h>

int xp_main()
{
	{
	xp_char_t buf[8];
	xp_printf (XP_TEXT("%u\n"), 
		xp_strxncpy (buf, xp_countof(buf), XP_TEXT("abcdefg"), 6));
	xp_printf (XP_TEXT("[%s]\n"), buf);
	}

	{
	xp_char_t buf[2];
	xp_printf (XP_TEXT("%u\n"), 
		xp_strxncpy (buf, xp_countof(buf), XP_TEXT("abcdefg"), 6));
	xp_printf (XP_TEXT("[%s]\n"), buf);
	}

	{
	xp_char_t buf[1];
	xp_printf (XP_TEXT("%u\n"), 
		xp_strxncpy (buf, xp_countof(buf), XP_TEXT("abcdefg"), 6));
	xp_printf (XP_TEXT("[%s]\n"), buf);
	}

	return 0;
}
